import store from '@/store';
export default [
    {
        path: '/login',
        name: 'login',
        component: resolve => require(['@/components/pages/Login'], resolve),
        hidden: true,
        beforeEnter: (to, from, next) => {
            // console.log(store.state)
            if (store.state.app.isLogin) {
                next('/index');
            } else {
                next();
            }
        }
    },
    {
        path: "/",
        component: resolve => require(['@/components/layout/Home2'], resolve),
        name: 'Home',
        iconCls: 'stats-bars',
        redirect: {
            path: '/index'
        },
        children: [
            {
                path: '/index',
                component: resolve => require(['@/components/views/home'], resolve),
                name: '首页',
                hidden: true
            },
            {
                path: '/userInfo',
                component: resolve => require(['@/components/views/UserInfo'], resolve),
                name: '用户信息',
                hidden: true
            },
            // {
            //     path: '/region',
            //     component: resolve => require(['@/views/system/region/region'], resolve),
            //     name: '区域管理',
            //     // hidden: true
            // },
            {
                path: '/main',
                component: resolve => require(['@/views/echarts'], resolve),
                name: '主页',
                hidden: true
            },
            {
                path: '/organizationManage',
                component: resolve => require(['@/views/system/org/organizationManage'], resolve),
                name: '组织管理'
            },
            {
                path: '/userManage',
                component: resolve => require(['@/views/system/user/userManage'], resolve),
                name: '用户管理'
            },
            {
                path: '/role',
                component: resolve => require(['@/views/system/role/role'], resolve),
                name: '角色管理'
            },
            {
                path: '/roleassign',
                component: resolve => require(['@/views/system/role/roleassign'], resolve),
                name: '角色授权'
            },
            {
                path: '/resource',
                component: resolve => require(['@/views/system/resource/resource'], resolve),
                name: '资源管理'
            },
            {
                path: '/logs',
                component: resolve => require(['@/views/system/log/logs'], resolve),
                name: '操作日志'
            },
            {
                path: '/bulletin',
                component: resolve => require(['@/views/system/bulletin/bulletin'], resolve),
                name: '公告管理'
            },
            {
                path: '/userM',
                component: resolve => require(['@/views/system/user/userM'], resolve),
                name: '人员管理'
            },
            {
                path: '/dept',
                component: resolve => require(['@/views/system/dept/dept'], resolve),
                name: '部门管理'
            },
            {
                path: '/region',
                component: resolve => require(['@/views/system/region/region'], resolve),
                name: '地域管理'
            },
            {
                path: '/param',
                component: resolve => require(['@/views/system/param/param'], resolve),
                name: '系统参数'
            },

        ]
    },
    {
        path: '*',
        redirect: '/notFound'
    },
    {
        path: '/404',
        component: resolve => require(['@/components/pages/NotFound'], resolve),
        name: '',
        hidden: true
    }
]
